<?php include"ZionHeader.inc"; ?>

<HTML>
<head>
<title>ZionsAuto</title>

  <link rel="stylesheet" href="styles.css" type="text/css" />

</head>


<BODY>
<h1><center>Welcome to Zion's Auto!</center></h1>



<?php
	$name = $_SESSION['UName']; // retrieve user ID
	$AccountType = $_SESSION['AType'];
	
	
	include 'DatabaseConnect.inc';
	
	if ($AccountType == 'R'){
		$queryName = "SELECT * FROM RegisteredUser WHERE LoginID = '$name'";
		$resultName = mysql_query($queryName);
		$rowName = mysql_fetch_array($resultName);
		echo 'Hello: '.$rowName['LName'].','.$rowName['FName'];
	}
	if ($AccountType == 'D'){
		$queryComp = "SELECT * FROM Dealer WHERE LoginID = '$name'";
		$resultComp = mysql_query($queryComp);
		$rowComp = mysql_fetch_array($resultComp);
		echo 'Welcome '.$rowComp['CompanyName'];
	}
	if ($AccountType=='A'){
		echo 'Welcome '.$name;
	}
	//mysql_close();
?>

<!-- Tab Menu Goes here -->
<div id="tabs">
  <ul>
    <li><a href="announcement.php"><span>Announcements</span></a></li>
    <li><a href="Browse.php"><span>Browse</span></a></li>
	
	<?php $AccountType = $_SESSION['AType'];
	if ($AccountType == 'R')
	{
		echo "<li id='dealerOnly'><a href='viewBookmark.php'><span>View Bookmarks</span></a></li>";
		echo "<li><a href='editProfile.php'><span>Edit Profile</span></a></li>";
	}
	
	
	if ($AccountType == 'A')
	{
		echo "<li><a href='statistics.php'><span>View statistics</span></a></li>";
		echo "<li><a href='users.php'><span>View users</span></a></li>";
	}
	?>
	
	<li><a href="logout.php"><span>Log Out</span></a></li>
	
  </ul>
</div>

<p> Welcome to Zion Auto, A high end automobile website </p>

<?php
if ($AccountType != 'A')
{
	include 'notifications.php';
}
?>

<!-- Footer Goes Here -->
<div id="footer">
<hr>
<P>(C)Copyright 2011 Zion's DBA. All Rights Reserved</P>
</div>

</BODY>
</HTML>
